#!/bin/sh
. $WM_PROJECT_DIR/bin/tools/RunFunctions

# Get application name
application=`getApplication`

cp -r 0.org 0
runApplication blockMesh

runApplication topoSet

unset FOAM_SETNAN
unset FOAM_SIGFPE

# Create first baffle
createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1

# Create region
runApplication extrudeToRegionMesh -overwrite

# Set the BC's for the baffle
runApplication changeDictionary -dict system/changeDictionaryDict.baffle
rm log.changeDictionary

# Set Bc's for the region baffle
runApplication changeDictionary -dict system/changeDictionaryDict.baffleRegion -literalRE
rm log.changeDictionary

# Reset proper values at the region
runApplication changeDictionary -region baffleRegion -literalRE

runApplication $application
